********************************************************************************
* Exporting representativeness table for multi-country COVID paper (BGD1 sample)
* last updated: 2020-10-22
* Salim Benhachmi
********************************************************************************

use "$da/BGD1", clear

local variables hhsize female_respondent hhh_edu hh_inc

foreach var of local variables {
		
	sum `var' if covid_sample == 1
	loc mean_`var'_samp = round(`r(mean)', 0.01)
}

foreach var of local variables {
		
	sum `var'
	loc mean_`var'_pop = round(`r(mean)', 0.01)
}

clear
set obs 5

gen sample_avg = .
gen population_avg = .

replace sample_avg = 1 in 1
replace population_avg = 1 in 1

replace sample_avg = `mean_hhsize_samp' in 2
replace population_avg = `mean_hhsize_pop' in 2

replace sample_avg = `mean_female_respondent_samp' in 3
replace population_avg = `mean_female_respondent_pop' in 3

replace sample_avg = `mean_hhh_edu_samp' in 4
replace population_avg = `mean_hhh_edu_pop' in 4

replace sample_avg = `mean_hh_inc_samp' in 5
replace population_avg = `mean_hh_inc_pop' in 5

gen sample_avg_weight = .
order sample_avg sample_avg_weight population_avg

gen national_avg = .
replace national_avg = 0.73 in 1
replace national_avg = 4.06 in 2
replace national_avg = 0.50 in 3
replace national_avg = 0.20 in 4
replace national_avg = 510 in 5

export excel using "$dtab/Representativeness Table.xlsx", sheetmodify cell(C7)

********************************************************************************
